<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2-卡片居中</title>
    <style>
        *{
            margin:0;
            padding:0;
            font-family: 'Micorsoft yahei';
        }
        .box{
            width: 272px;
            height: 350px;
            /* 1个像素的实线是红色的 */
            border: 1px solid red;
            /* 水平居中 */
            margin: 0 auto;
            text-align: center;
        }
        img{
            width: 120px;
            height: 150px;
            /* 让设置宽高的图片生效，变成一个块元素 */
            display: block;
            /*让块元素居中*/
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <!-- 
        printScreen
     -->
    <div class="box">
        <img src="images/car.jpg" alt="">
        <p>小米11</p>
        <p style="color:#ccc;">晓龙888|2k曲面屏</p>
        <p style="color:#f60;font-size:18px;">&yen;3999元</p>
    </div>
</body>
</html>